package com.example.controller;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.example.App;
import com.example.dao.NoteDao;
import jakarta.annotation.Resource;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author: keke
 * @date: 2024/8/7
 */
@Transactional(propagation = Propagation.SUPPORTS, isolation = Isolation.READ_COMMITTED)
@RestController
public class TestController {
	@Resource
	private NoteDao noteDao;
	//@Resource
	//private FileDao fileDao;

	@GetMapping("/ping")
	public String ping() {
		QueryWrapper queryWrapper = new QueryWrapper();
		queryWrapper.eq("id", 1);
		return App.getUUID() + noteDao.selectList(queryWrapper) + "<hr/>";
		//+ fileDao.selectList(queryWrapper);
	}
}
